Skip to content

feat(davinci-client): send FIDO errors to DaVinci - #728

Closed
ancheetah wants to merge 3 commits into
SDKS-5100-metadata-collectorfrom
SDKS-4480-fido-errors
Closed

feat(davinci-client): send FIDO errors to DaVinci#728
ancheetah wants to merge 3 commits into
SDKS-5100-metadata-collectorfrom
SDKS-4480-fido-errors

Conversation

@ancheetah

@ancheetah ancheetah commented Jul 23, 2026

Copy link
Copy Markdown
Collaborator

JIRA Ticket

https://pingidentity.atlassian.net/browse/SDKS-4480

Description

Most of this was taken from #503.
TODO: wire up flow for FIDO errors and write e2e tests

Note: This also fixes a false positive from password validation test and corrects some wiring in the registration node in the flow.

@changeset-bot

changeset-bot Bot commented Jul 23, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 60d9743

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 12 packages
Name Type
@forgerock/davinci-client Minor
@forgerock/device-client Minor
@forgerock/journey-client Minor
@forgerock/oidc-client Minor
@forgerock/protect Minor
@forgerock/sdk-types Minor
@forgerock/sdk-utilities Minor
@forgerock/iframe-manager Minor
@forgerock/sdk-logger Minor
@forgerock/sdk-oidc Minor
@forgerock/sdk-request-middleware Minor
@forgerock/storage Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 1c335e6d-a3c7-4459-99ab-a5884aa86f84

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch SDKS-4480-fido-errors

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@nx-cloud

nx-cloud Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

View your CI Pipeline Execution ↗ for commit 60d9743

Command Status Duration Result
nx affected -t build lint test typecheck e2e-ci ❌ Failed 6m 10s View ↗

💡 Dealing with memory or CPU issues? See memory and CPU details with the resource usage add-on ↗.


☁️ Nx Cloud last updated this comment at 2026-07-28 20:54:40 UTC

@pkg-pr-new

pkg-pr-new Bot commented Jul 23, 2026

Copy link
Copy Markdown

Open in StackBlitz

@forgerock/davinci-client

pnpm add https://pkg.pr.new/@forgerock/davinci-client@728

@forgerock/device-client

pnpm add https://pkg.pr.new/@forgerock/device-client@728

@forgerock/journey-client

pnpm add https://pkg.pr.new/@forgerock/journey-client@728

@forgerock/oidc-client

pnpm add https://pkg.pr.new/@forgerock/oidc-client@728

@forgerock/protect

pnpm add https://pkg.pr.new/@forgerock/protect@728

@forgerock/sdk-types

pnpm add https://pkg.pr.new/@forgerock/sdk-types@728

@forgerock/sdk-utilities

pnpm add https://pkg.pr.new/@forgerock/sdk-utilities@728

@forgerock/iframe-manager

pnpm add https://pkg.pr.new/@forgerock/iframe-manager@728

@forgerock/sdk-logger

pnpm add https://pkg.pr.new/@forgerock/sdk-logger@728

@forgerock/sdk-oidc

pnpm add https://pkg.pr.new/@forgerock/sdk-oidc@728

@forgerock/sdk-request-middleware

pnpm add https://pkg.pr.new/@forgerock/sdk-request-middleware@728

@forgerock/storage

pnpm add https://pkg.pr.new/@forgerock/storage@728

commit: 5165254

@codecov-commenter

codecov-commenter commented Jul 23, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 71.17117% with 32 lines in your changes missing coverage. Please review.
✅ Project coverage is 23.73%. Comparing base (a2cae19) to head (5165254).

Files with missing lines Patch % Lines
packages/davinci-client/src/lib/davinci.api.ts 0.00% 19 Missing ⚠️
packages/davinci-client/src/lib/fido/fido.ts 72.72% 12 Missing ⚠️
packages/davinci-client/src/types.ts 50.00% 1 Missing ⚠️

❌ Your project status has failed because the head coverage (23.73%) is below the target coverage (40.00%). You can increase the head coverage or adjust the target coverage.

Additional details and impacted files
@@                       Coverage Diff                        @@
##           SDKS-5100-metadata-collector     #728      +/-   ##
================================================================
+ Coverage                         23.26%   23.73%   +0.47%     
================================================================
  Files                               161      162       +1     
  Lines                             25667    25718      +51     
  Branches                           1626     1661      +35     
================================================================
+ Hits                               5971     6104     +133     
+ Misses                            19696    19614      -82     
Files with missing lines Coverage Δ
packages/davinci-client/src/lib/client.types.ts 100.00% <ø> (ø)
packages/davinci-client/src/lib/collector.types.ts 100.00% <ø> (ø)
packages/davinci-client/src/lib/davinci.utils.ts 86.41% <100.00%> (ø)
packages/davinci-client/src/lib/fido/fido.types.ts 100.00% <100.00%> (ø)
packages/davinci-client/src/lib/fido/fido.utils.ts 99.24% <100.00%> (+0.28%) ⬆️
packages/davinci-client/src/lib/node.reducer.ts 74.60% <100.00%> (+0.40%) ⬆️
packages/davinci-client/src/types.ts 11.11% <50.00%> (-1.39%) ⬇️
packages/davinci-client/src/lib/fido/fido.ts 85.32% <72.72%> (+84.45%) ⬆️
packages/davinci-client/src/lib/davinci.api.ts 27.85% <0.00%> (-1.69%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions

github-actions Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Deployed cbc6c62 to https://ForgeRock.github.io/ping-javascript-sdk/pr-728/cbc6c624f4639f45580dbe657cceeec5aac73016 branch gh-pages in ForgeRock/ping-javascript-sdk

@github-actions

github-actions Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

📦 Bundle Size Analysis

📦 Bundle Size Analysis

🚨 Significant Changes

🔺 @forgerock/davinci-client - 56.9 KB (+2.5 KB, +4.5%)

🆕 New Packages

🆕 @forgerock/journey-client - 92.6 KB (new)
🆕 @forgerock/journey-client - 0.0 KB (new)
🆕 @forgerock/device-client - 10.0 KB (new)
🆕 @forgerock/device-client - 0.0 KB (new)

➖ No Changes

@forgerock/sdk-types - 9.1 KB
@forgerock/sdk-logger - 1.6 KB
@forgerock/iframe-manager - 3.2 KB
@forgerock/sdk-oidc - 5.7 KB
@forgerock/storage - 1.5 KB
@forgerock/sdk-request-middleware - 4.6 KB
@forgerock/sdk-utilities - 18.6 KB
@forgerock/oidc-client - 35.3 KB
@forgerock/protect - 144.6 KB


14 packages analyzed • Baseline from latest main build

Legend

🆕 New package
🔺 Size increased
🔻 Size decreased
➖ No change

ℹ️ How bundle sizes are calculated
  • Current Size: Total gzipped size of all files in the package's dist directory
  • Baseline: Comparison against the latest build from the main branch
  • Files included: All build outputs except source maps and TypeScript build cache
  • Exclusions: .map, .tsbuildinfo, and .d.ts.map files

🔄 Updated automatically on each push to this PR

@ancheetah
ancheetah force-pushed the SDKS-5100-metadata-collector branch from 8693a1d to a2cae19 Compare July 23, 2026 21:05

@cerebrl cerebrl left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems this PR is based on the Metadata PR. If I look at just the FIDO related commit, it looks good. But, this also contains the other unrelated changes for Metadata, so I'm hesitate to approve as this may be a mistake.

@SteinGabriel

SteinGabriel commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

I can see that the FIDO GenericError is being created and returned, but I don't see it being propagated back to the DaVinci flow in davinci.api.ts, as the ticket seems to imply.
I'd like to confirm whether sending the FIDO error code back in a request to DaVinci is consumer-owned rather than SDK-owned, or if I'm missing something in the implementation.
Everything else related to the FIDO changes looks good!

Edit: I just saw in the description that wiring up the flow is in TODO. I'll do another review when that's done.

@ancheetah

Copy link
Copy Markdown
Collaborator Author

Sorry about that everyone, I am about to push up the part where we send the payload to DaVinci. Looks like my rebase got messed up because metadata shouldn't be in here. Let me fix and let you know when it's ready again.

@ancheetah
ancheetah force-pushed the SDKS-4480-fido-errors branch from 79ba07f to acd6de3 Compare July 24, 2026 16:59
nx-cloud[bot]

This comment was marked as outdated.

@ancheetah
ancheetah force-pushed the SDKS-4480-fido-errors branch from acd6de3 to 5165254 Compare July 24, 2026 23:48
@ancheetah
ancheetah force-pushed the SDKS-5100-metadata-collector branch 3 times, most recently from 44abe1c to fc0caf2 Compare July 28, 2026 20:03
@ancheetah
ancheetah force-pushed the SDKS-4480-fido-errors branch from 5165254 to 60d9743 Compare July 28, 2026 20:47

@nx-cloud nx-cloud Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nx Cloud is proposing a fix for your failed CI:

We resolved three TypeScript compilation errors introduced by the metadata collector feature. The duplicate MetadataError definition (in both collector.types.ts and the new metadata.types.ts) caused a TS2308 ambiguous re-export in src/types.ts, which we fixed by having metadata.types.ts re-export from collector.types.ts and adding an explicit named export in src/types.ts to resolve the conflict. We also corrected the MetadataError import source in client.store.ts and added GenericError to DaVinciRequestValueTypes so FIDO error values can flow through the request transform in davinci.utils.ts.

Tip

We verified this fix by re-running @forgerock/davinci-client:typecheck, @forgerock/davinci-client:build.

Suggested Fix changes
diff --git a/packages/davinci-client/src/lib/client.store.ts b/packages/davinci-client/src/lib/client.store.ts
index 5e16d42..7691d09 100644
--- a/packages/davinci-client/src/lib/client.store.ts
+++ b/packages/davinci-client/src/lib/client.store.ts
@@ -52,8 +52,8 @@ import type {
   Validator,
   Poller,
   CollectorValueTypes,
-  MetadataError,
 } from './client.types.js';
+import type { MetadataError } from './collector.types.js';
 import { returnValidator } from './collector.utils.js';
 import { returnPasswordPolicyValidator } from './password-policy.rules.js';
 import type { ContinueNode, StartNode } from './node.types.js';
diff --git a/packages/davinci-client/src/lib/davinci.types.ts b/packages/davinci-client/src/lib/davinci.types.ts
index 7fd8bfd..8c6460d 100644
--- a/packages/davinci-client/src/lib/davinci.types.ts
+++ b/packages/davinci-client/src/lib/davinci.types.ts
@@ -13,6 +13,7 @@ import type {
   FetchBaseQueryMeta,
   MutationResultSelectorResult,
 } from '@reduxjs/toolkit/query';
+import type { GenericError } from '@forgerock/sdk-types';
 import {
   DeviceValue,
   PhoneNumberInputValue,
@@ -46,7 +47,8 @@ export type DaVinciRequestValueTypes =
   | PhoneNumberInputValue
   | FidoRegistrationInputValue
   | FidoAuthenticationInputValue
-  | MetadataError;
+  | MetadataError
+  | GenericError;
 
 /**
  * Base Response for DaVinci API
diff --git a/packages/davinci-client/src/lib/utils/metadata.types.ts b/packages/davinci-client/src/lib/utils/metadata.types.ts
index fb2e3d1..fbe1957 100644
--- a/packages/davinci-client/src/lib/utils/metadata.types.ts
+++ b/packages/davinci-client/src/lib/utils/metadata.types.ts
@@ -5,7 +5,4 @@
  * of the MIT license. See the LICENSE file for details.
  */
 
-export interface MetadataError {
-  code: string;
-  message: string;
-}
+export type { MetadataError } from '../collector.types.js';
diff --git a/packages/davinci-client/src/types.ts b/packages/davinci-client/src/types.ts
index 45427dd..90ead57 100644
--- a/packages/davinci-client/src/types.ts
+++ b/packages/davinci-client/src/types.ts
@@ -21,6 +21,8 @@ export * from './lib/client.types.js';
 export * from './lib/node.types.js';
 
 // All collector types (single-value, multi-value, object-value, auto-collectors, etc.)
+// MetadataError is explicitly re-exported to resolve ambiguity with ./lib/utils/utils.types.js
+export type { MetadataError } from './lib/collector.types.js';
 export * from './lib/collector.types.js';
 
 // Fido types

🔔 Heads up, your workspace has pending recommendations ↗ to auto-apply fixes for similar failures.

Apply fix via Nx Cloud  Reject fix via Nx Cloud


Or Apply changes locally with:

npx nx-cloud apply-locally aEP6-3Qjh

Apply fix locally with your editor ↗   View interactive diff ↗



🎓 Learn more about Self-Healing CI on nx.dev

@ancheetah

Copy link
Copy Markdown
Collaborator Author

Closing in favor of #730

@ancheetah ancheetah closed this Jul 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants